#pragma once

//
// This class simply maintains a list of sensors supported by
// this driver.
//
class CSensorRegistry
{
protected:
	static map<wstring, CSensor *>		s_mapSensors;
	static CComAutoCriticalSection		s_cs;

public:
	static void RegisterSensor(const CSensor *pSensor);
	static vector<CSensor *> GetRegisteredSensors(bool excludeDeviceSensor = true);
	static CSensor *GetSensorById(const wstring& id);
};

//
// Helper class to ensure that sensors get registered when
// this DLL loads.  See macro "IMPLEMENT_SENSOR".
//
template<typename T>
class CSensorRegistrar
{
public:
	CSensorRegistrar()
	{
		CSensorRegistry::RegisterSensor(new T());
	}
};
